/**
 * 
 */
package com.aqarat.managedBean;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import com.administration.entity.Access;
import com.aqarat.entity.Building;
import com.aqarat.service.AqaratService;
import com.core.managedBean.BaseBean;

/**
 * @author karimsherif
 * 
 */
//@ManagedBean
@Named("aqaratIndexBean")
@ViewScoped
public class AqaratIndexBean extends BaseBean {
	private static final long serialVersionUID = 1L;

	@Inject
	private AqaratService aqaratService;

	@PostConstruct
	public void loadData() {
		System.out.println(":::::::::::::::::  1");
	}

	public void saveBuilding() {
//		Building b = new Building();
//		b.setAddress("manshia");
//		b.setNumberOfFloors(11L);
//		b.setName("Rawda");
//		b.setExpenses(100000D);
//		b.setRevenues(50000D);
//		aqaratService.addBuilding(b);
//		System.out.println(b);
//		System.out.println("welcom");
		
		Access a=new Access();
		a.setName("redon");
		aqaratService.addAccess(a);
		System.out.println("ddddddddddd");
	}
}
